package com.chris.blog.service.impl;

import com.chris.blog.dao.InviteDao;
import com.chris.blog.entity.po.InvitePO;
import com.chris.blog.service.InviteService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class InviteServiceImpl implements InviteService {

    @Resource
    private InviteDao inviteDAO;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int deleteByPrimaryKey(Integer id) {
        return inviteDAO.deleteByPrimaryKey(id);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insert(InvitePO record) {
        return inviteDAO.insert(record);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insertSelective(InvitePO record) {
        return inviteDAO.insertSelective(record);
    }

    @Override
    public InvitePO selectByPrimaryKey(Integer id) {
        return inviteDAO.selectByPrimaryKey(id);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int updateByPrimaryKeySelective(InvitePO record) {
        return inviteDAO.updateByPrimaryKeySelective(record);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int updateByPrimaryKey(InvitePO record) {
        return inviteDAO.updateByPrimaryKey(record);
    }

    public List<InvitePO> findAll() {
        return inviteDAO.findAll();
    }
}
